<?php

namespace App\Facades;

use AlibabaCloud\Client\Exception\ClientException;
use AlibabaCloud\Client\Exception\ServerException;
use AlibabaCloud\Domain\Domain;

class AliyunDomain extends AliyunFacade
{
    /**
     * @throws ClientException
     * @throws ServerException
     */
    public function total(): int
    {
        $res = Domain::v20180129()
            ->queryDomainList()
            ->withPageNum(1)
            ->withPageSize(1)
            ->request();

        return $res->get('TotalItemNum');
    }
}
